home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 1 / CU Amiga Magazine CD-ROM Special Edition (1995)(EMAP Images)(GB)[Issue 1995-11].iso / Aminet / comm / tcp / AmiTCPsdk_40.lha / AmiTCP-4.0 / netinclude / net / if.h < prev    next >
C/C++ Source or Header  |  1994-10-05  |  3KB  |  85 lines

  1. #ifndef NET_IF_H
  2. #define NET_IF_H \
  3.        "$Id: if.h,v 4.4 1994/10/05 23:12:24 ppessi Exp $"
  4. /*
  5.  *      Network interface definitions
  6.  *
  7.  *      Copyright © 1994 AmiTCP/IP Group,
  8.  *                       Network Solutions Development, Inc.
  9.  *                       All rights reserved.
  10.  */
  11.  
  12.  
  13. /*
  14.  * Interface request structure used for socket
  15.  * ioctl's.  All interface ioctl's must have parameter
  16.  * definitions which begin with ifr_name.  The
  17.  * remainder may be interface specific.
  18.  */
  19. struct    ifreq {
  20. #define    IFNAMSIZ    16
  21.     char    ifr_name[IFNAMSIZ];        /* if name, e.g. "en0" */
  22.     union {
  23.         struct    sockaddr ifru_addr;
  24.         struct    sockaddr ifru_dstaddr;
  25.         struct    sockaddr ifru_broadaddr;
  26.         short    ifru_flags;
  27.         int    ifru_metric;
  28.         caddr_t    ifru_data;
  29.     } ifr_ifru;
  30. #define    ifr_addr    ifr_ifru.ifru_addr    /* address */
  31. #define    ifr_dstaddr    ifr_ifru.ifru_dstaddr    /* other end of p-to-p link */
  32. #define    ifr_broadaddr    ifr_ifru.ifru_broadaddr    /* broadcast address */
  33. #define    ifr_flags    ifr_ifru.ifru_flags    /* flags */
  34. #define    ifr_metric    ifr_ifru.ifru_metric    /* metric */
  35. #define    ifr_data    ifr_ifru.ifru_data    /* for use by interface */
  36. };
  37.  
  38. struct ifaliasreq {
  39.     char    ifra_name[IFNAMSIZ];        /* if name, e.g. "en0" */
  40.     struct    sockaddr ifra_addr;
  41.     struct    sockaddr ifra_broadaddr;
  42.     struct    sockaddr ifra_mask;
  43. };
  44.  
  45. /*
  46.  * Structure used in SIOCGIFCONF request.
  47.  * Used to retrieve interface configuration
  48.  * for machine (useful for programs which
  49.  * must know all networks accessible).
  50.  */
  51. struct    ifconf {
  52.     int    ifc_len;        /* size of associated buffer */
  53.     union {
  54.         caddr_t    ifcu_buf;
  55.         struct    ifreq *ifcu_req;
  56.     } ifc_ifcu;
  57. #define    ifc_buf    ifc_ifcu.ifcu_buf    /* buffer address */
  58. #define    ifc_req    ifc_ifcu.ifcu_req    /* array of structures returned */
  59. };
  60.  
  61. #define    IFF_UP        0x1        /* interface is up */
  62. #define    IFF_BROADCAST    0x2        /* broadcast address valid */
  63. #define    IFF_DEBUG    0x4        /* turn on debugging */
  64. #define    IFF_LOOPBACK    0x8        /* is a loopback net */
  65. #define    IFF_POINTOPOINT    0x10        /* interface is point-to-point link */
  66. #define    IFF_NOTRAILERS    0x20        /* avoid use of trailers */
  67. #define    IFF_RUNNING    0x40        /* resources allocated */
  68. #define    IFF_NOARP    0x80        /* no address resolution protocol */
  69. #define    IFF_SIMPLEX    0x800        /* can't hear own transmissions */
  70.  
  71. /* next two not supported now, but reserved: */
  72. #define    IFF_PROMISC    0x100        /* receive all packets */
  73. #define    IFF_ALLMULTI    0x200        /* receive all multicast packets */
  74. #define    IFF_OACTIVE    0x400        /* transmission in progress */
  75.  
  76. /* flags set internally only: */
  77. #define    IFF_CANTCHANGE \
  78.     (IFF_BROADCAST|IFF_POINTOPOINT|IFF_RUNNING|IFF_OACTIVE|IFF_SIMPLEX)
  79.  
  80. #ifndef NET_IF_ARP_H
  81. #include <net/if_arp.h>
  82. #endif
  83.  
  84. #endif /* IF_H */
  85.